import shutil

from utils.file_io import listdir, file_r, file_w

if __name__ == '__main__':
    txt_root_path = r"G:\vediodownload\原神分级\遗漏\txt"
    sound_root_path = r"G:\vediodownload\七海\7wav"
    transcript_root_path = r"G:\vediodownload\原神分级\遗漏"
    min_length = 2000

    txt_file_list = []
    txt_dict = {}
    listdir(txt_root_path, txt_file_list)
    for txt_path in txt_file_list:
        txt_name = txt_path.split("/")[-1:][0].replace(".txt", "").replace("CHS_", "")
        txt_list = []
        txt_string = file_r(txt_path).replace("\n", "")
        file_w(transcript_root_path + r"\transcript.txt", txt_name + " " + txt_string + "\n", "a")
        txt_dict[txt_name] = txt_string
        shutil.move(sound_root_path+"\\input\\"+txt_name+".wav", sound_root_path+"\\output\\"+txt_name+".wav")
